<script setup>
import { ref } from 'vue';

defineProps({
  introduce: Object,
  index: Number,
  readMore: Boolean
});

const count = ref(0);
</script>

<template>
<div class="introduceProject">
    <div class="introduceProject-top">
        <img :src=introduce.coverimage />
        <span  v-if="index == 0 || index == 1" class="introduceProject-top-tip">推荐</span>
    </div>
    <div class="introduceProject-title">{{introduce.titile}}</div>
     <div class="introduceProject-subtitle">{{introduce.subtitle}}</div>
      <div class="introduceProject-wrap">
        <div v-if="readMore" class="look-more">
            查看详情
        </div>
        <span v-else class="introduceProject-wrap-left">
            <span>{{introduce.reads}}</span>
            人咨询
        </span>
         <span class="introduceProject-wrap-right">
            ¥
            <span>{{introduce.price}}</span>
        </span>
      </div>
</div>
</template>

<style scoped lang="less">
.introduceProject {
    margin-bottom: 20px;
    width: 187px;
    height: 215px;
    background: #FFFFFF;
    box-shadow: 0px 0px 5px 4px rgba(115,115,115,0.0500);
    border-radius: 14px;
    .introduceProject-top{
        position: relative;
        width: 187px;
        height: 107px;
        margin-bottom: 9px;
        border-radius: 30px 30px 0 0;
        img {
            width: 100%;
            height: 100%;
            border-radius:14px 14px 0px 0px;
        }
        .introduceProject-top-tip {
            position: absolute;
            left: 0;
            top: -8px;
            width: 39px;
            height: 16px;
            background-image: url('../../../assets/images/homepage-tuijian.png');
            background-size: 100%;
            border-radius: 12px 14px 14px 0px;
            font-size: 9px;
            font-family: PingFangSC-Medium, PingFang SC;
            font-weight: 500;
            color: #FFFFFF;
            line-height: 13px;  
            text-align: center;
            line-height: 16px;
        }
    }
    .introduceProject-title {
        font-size: 21px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: #000000;
        line-height: 29px;
        margin-bottom: 2px;
        padding: 0 6px;
        overflow: hidden;
        text-overflow:ellipsis;
        white-space: nowrap;
    }
    .introduceProject-subtitle {
        font-size: 16px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #111111;
        line-height: 22px;
        margin-bottom: 9px;
        padding: 0 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .introduceProject-wrap {
        padding: 0 6px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .look-more {
            width: 85px;
            height: 27px;
            border-radius: 16px;
            border: 1px solid #C5B6FD;
            font-size: 13px;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #000000;
            line-height: 27px;
            text-align: center;
        }
        .introduceProject-wrap-left {
            font-size: 14px;
            font-family: PingFangSC-Medium, PingFang SC;
            font-weight: 500;
            color: #999999;
            line-height: 20px;  
            display: flex;
            align-items: center;
            span {
                font-size: 21px;
                font-family: PingFangSC-Regular, PingFang SC;
                font-weight: 400;
                color: #999999;
                line-height: 29px;
                max-width: 50px;
                display: inline-block;
                overflow: hidden;
                text-overflow:ellipsis;
                white-space: nowrap;
            }
        }
        .introduceProject-wrap-right {
            color: #FF544D;
            font-size: 16px;
            span {
                font-size: 21px;
                font-family: PingFangSC-Medium, PingFang SC;
                font-weight: 500;
                color: #FF544D;
                line-height: 29px;
            }
        }
    }
}

</style>
